package com.sntk.organauthomanager.infrastructure.db.repository;

import com.sntk.organauthomanager.infrastructure.db.entity.UserEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserDBRepository extends JpaRepository<UserEntity, Long>, JpaSpecificationExecutor<UserEntity> {
    UserEntity findFirstByUnameAndDelFalse(String uname);
    List<UserEntity> findAllByInstitutionNumberAndDelFalseAndDisabledFalse(String institutionNumber);
    List<UserEntity> findAllByInstitutionNumberAndUnameNotInAndDelFalseAndDisabledFalse(String institutionNumber, List<String> unames);
}
